ESP8266 VoIP/RTP pager
Experimental, very simple RTP pager (audio receiver) based on ESP8266 SoC.
Many VoIP phones (most of the phones with "BLF") have RTP streaming function - usually
they can work both as RTP senders and receivers. After pressing button phone starts sending audio RTP stream to specified
address (either unicast or multicast) and port where other device(s) are expected to receive it.
tSIP softphone is also able to transmit RTP stream, sending either audio from PC sound card or content
of specified wave file. Multiple buttons can be programmed to start sending different audio files to different destinations.
RTP streaming is also available through plugin interface (see: Lua scripting).
For G.711a streaming from wave file use PCM S16, mono, 8000 samples per second format (example: lin.wav), copy it
to softphone directory and enter its name on "Behavior" button config.
If wave file is not specified application would use default audio source (same as for regular calls, e.g. microphone).
With very low cost - just by adding RC filter, power supply, optionally audio amplifier - RTP receiver can be built with ESP8266 SoC.
To a high degree it was inspired by MP3 decoder
and it uses this project PWM I2S audio output code, in particular delta-sigma version.
Good power supply filtering is required. Since application is processing typically 50 packets per seconds during streaming (+ regular traffic) current consumption may be higher than in typical IoT applications. Output audio quality can be also degraded by power supply and/or poor connections - in my test setup it required try and error (decoupling, changing ground connection point for headphones) to eliminate disturbances with ESP8266 connected to breadboard. This kind of problems manifest as audible noises on packet reception (even ping) but is distinguishable from software, network or buffering issues as it varies when changing electrical connections.
Limitations:
- multicast seems to be not working at the moment thus it is disabled - further testing needed
- no user-friendly interface to configure WiFi settings
- no proper resampling / clock difference compensation
- bunch of other major and minor bugs - use with care
Source includes Code::Blocks project (see ESP8266+gcc page), although command line make can be used directly as well.
Source:
- Initial: RTP_pager.zip (built with ESP8266 DevKit v2.0.9).
- 2016.04.13 RTP_pager_20160413.zip
- added Buffering -> Idle state transition for jitter buffer to clear its content
- minor cleanup
- 2016.05.08 RTP_pager_20160508.zip
- fixed few bugs related to buffering
- 2016.05.12 RTP_pager_20160512.zip
- support for G.722 (aka "HD" telephony, 16ksps, test source file for tSIP 0.01.44+: lin_16k.wav)
- limited input signal for 2nd order delta-sigma DAC to avoid instability, see http://classes.engr.oregonstate.edu/eecs/spring2010/ece627/Lectures/2nd%20%26%20Higher-Order2.pdf
- 2016.05.26 RTP_pager_20160526.zip
- SDK updated from version 1.5.0 to 1.5.4 and UDK to current beta version; this is supposed to eliminate "mac 674" problem (see: http://bbs.espressif.com/viewtopic.php?t=1205), although it did not help with occasional "dev 1143" resets
- changed CPU clock to 160MHz - this actually helps with "dev 1143" (probably not completely but it definitely reduced number of time it happens)
- 2016.11.20 RTP_pager_20161120.zip
- UDK updated to version 2.2.1
- this is configured for ESP201 (1MB flash)
- note: settings.mk needs selecting proper FLASH size; second place that may need editing for the same reason is flashinit target in common_nonos.mk, see comments inside
- run flashinit target (esp_init_data_default.bin + blank.bin programming) if your ESP8266 is restarting with "rf_cal[0] !=0x05,is 0xFF" message
- UART is configured with 230400 bps, 8N1
- 2016.12.04 RTP_pager_20161204.zip
- firmware is configured in Soft-AP mode - connect to AUDIO_xxxxxxxxxxxx station, password is the same as station name and DHCP is active (192.168.4.x, ESP8266 is at 192.168.4.1 address and listening for RTP on UDP port 7777)
- I2S frequency reduced to 16kHz - it seems to be eliminating stability issue
RTP streamer for android
Very simple RTP streamer (sender) for android: app-debug.apk with source code: RtpStreamer.7z.
As this uses built-in RTP android streaming it is limited to G.711a (no G.722 available).